<!DOCTYPE html>
<html lang = "en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Vue Tian</title>
  
    <style>
        .active{
            border: 1px solid red;
        }
    </style>

</head>

<body>
    <h1>Hello!</h1>
    <input type="button" value="GET" class="get" @click="getjoke">
    <input type="button" value="POST" class="post">
    <p id="joke" >
        {{joke}}
    </p>

    <div class ="wrap" id="app">
        <div class="search">
            <input type="text" placeholder="请输入查询的地方" v-model = "city" @keyup.enter="updata">
            <button @click = "updata">搜索</button>
            <br>
            <a href="javascript:;" @click="changeCity('beijing')" >北京</a>
            <a href="javascript:;" @click="changeCity('shanghai')" >上海</a>
            <a href="javascript:;" @click="changeCity('guangzhou')" >广州</a>
            <a href="javascript:;" @click="changeCity('dongguan')" >东莞</a>
        </div>
        <div class="city">
            <ul>
                <li v-for = "item in weatherList">
                    {{item.dt_txt.substring(0,10)}},{{item.weather[0].main}} , {{Math.floor(item.main.temp - 273)}}℃
                </li>
            </ul>
        </div>
    </div>

    <!-- vue.js -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="./main.js"></script>
    
</body>

</html>